package soccerscope.model;

import java.io.Serializable;

/**
 * list item of the starts of play modes
 * 
 * @author benjaboe
 * 
 */
public class ScenePlayModeListItem
    implements Serializable {

  private static final long serialVersionUID = 7685979949471770022L;

  /** the scene number where the play mode starts. */
  private int               scene;

  /** the cycle number which is shown by the SoccerScope. */
  private int               cycle;

  /** the new play mode. */
  private PlayMode          mode;

  /**
   * Creates a new reference of a beginning play mode.
   * 
   * @param sceneNumber
   *          number of the scene where the new play mode starts
   * @param the
   *          cycle number which is shown by the SoccerScope
   * @param playMode
   *          the new play mode
   */
  public ScenePlayModeListItem(
      int sceneNumber,
      int cycleNumber,
      PlayMode playMode) {

    this.scene = sceneNumber;
    this.cycle = cycleNumber;
    this.mode = playMode;
  }

  /**
   * Returns the scene number where the play mode starts.
   * 
   * @return the scene number where the play mode starts.
   */
  public PlayMode getMode() {

    return this.mode;
  }

  /**
   * the new play mode.
   * 
   * @return the new play mode.
   */
  public int getScene() {

    return this.scene;
  }

  /**
   * Returns the cycle number which is shown by the SoccerScope.
   * 
   * @return the cycle number which is shown by the SoccerScope
   */
  public int getCycle() {

    return this.cycle;
  }

  @Override
  public String toString() {

    return String.format("% 6d", this.cycle).substring(1).replaceAll("( *)",
        "$1$1") + " - " + this.mode.toString();
  }

}
